package com.yunxi.service.dubboService.impl.sys;

import com.yunxi.model.sys.RoleUser;
import com.yunxi.service.localService.sys.RoleUserService;
import com.yunxi.sys.pojo.RoleUserVO;
import com.yunxi.sys.pojo.RoleVO;
import com.yunxi.sys.pojo.UserVO;
import com.yunxi.sys.service.RoleUserDubboService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 字典表 服务实现类
 * </p>
 * @author
 * @since 2019-05-08
 */
public class RoleUserDubboServiceImpl implements RoleUserDubboService {

    @Autowired
    @Qualifier(value = "roleUserServiceImpl")
    RoleUserService roleUserService;

    @Override
    public List listByRoleId(String roleId) throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
        return roleUserService.listByRoleId(roleId);
    }

    @Override
    public List listByRoleCode(String roleCode){
        return roleUserService.listByRoleCode(roleCode);
    }

    @Override
    public void saveRoleUserList(RoleUserVO roleMenu, String userId) {
        roleUserService.saveRoleUserList(roleMenu,userId);
    }

    @Override
    public void save(RoleUserVO ru) throws InvocationTargetException, IllegalAccessException {
        RoleUser ru_ = new RoleUser();
        BeanUtils.copyProperties(ru,ru_);
        roleUserService.save(ru_);
    }

    @Override
    public void delByUserId(String userId) {
        roleUserService.delById(userId);
    }

    @Override
    public List<RoleVO> listByDomainId(String domainId) {
        return roleUserService.listByDomainId(domainId);
    }

    @Override
    public List<RoleUserVO> listByUserId(String userId) {
        return roleUserService.listByUserId(userId);
    }

    @Override
    public void saveRoleUserList(RoleUserVO roleUser) {
        roleUserService.saveRoleUserList(roleUser);
    }

    @Override
    public List<RoleVO> listByAccount(String accountNo) {
        return roleUserService.listRoleByAccountNo(accountNo);
    }

    @Override
    public List<UserVO> userListByRoleId(String roleId) {
        return roleUserService.userListByRoleId(roleId);
    }
}
